/**
 * Copyright 2018-2020 Streamlit Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import "variables";
@import "fonts";
@import "~bootstrap/scss/bootstrap";
@import "src/assets/css/mixins";
@import "scrollbars";

// IMPORTANT! This must come after the bootstrap import.
// Styletron creates classes called h1, h2, etc., which conflict with Bootstrap classes.
// So we have to override the bootstrap classes here. (We should not use these classes in our project)
.h1,
.h2,
.h3,
.h4,
.h5,
.h6 {
  all: unset;
}

// Use this file to override specific bootstrap styles.

.btn-outline-primary {
  border-color: $gray-lighter;
  color: $black;
}

.btn-outline-secondary {
  border-color: transparent;
  color: $black;
}

.btn-outline-info {
  background-color: $white;
  border-color: $gray-lighter;
  color: $gray-darker;
}

.btn-outline-primary:not(:disabled):not(.disabled):hover,
.btn-outline-secondary:not(:disabled):not(.disabled):hover,
.btn-outline-info:not(:disabled):not(.disabled):hover,
.btn-outline-primary:not(:disabled):not(.disabled):focus,
.btn-outline-secondary:not(:disabled):not(.disabled):focus,
.btn-outline-info:not(:disabled):not(.disabled):focus {
  background-color: $white;
  border-color: $primary;
  color: $primary;
}

.btn-outline-primary:not(:disabled):not(.disabled):focus,
.btn-outline-secondary:not(:disabled):not(.disabled):focus,
.btn-outline-info:not(:disabled):not(.disabled):focus {
  box-shadow: 0 0 0 0.2rem $primary-a50;
}

.btn-outline-primary:not(:disabled):not(.disabled).active,
.btn-outline-primary:not(:disabled):not(.disabled):active,
.btn-outline-secondary:not(:disabled):not(.disabled).active,
.btn-outline-secondary:not(:disabled):not(.disabled):active,
.btn-outline-info:not(:disabled):not(.disabled).active,
.btn-outline-info:not(:disabled):not(.disabled):active {
  background-color: $primary;
  border-color: $primary;
  color: $white;
}

// Make alert boxes work on different backgrounds.

.alert-success {
  background: change-color($green, $alpha: 0.2);
  border-color: change-color($green, $alpha: 0.2);
}

.alert-info {
  background: change-color($blue, $alpha: 0.1);
  border-color: change-color($blue, $alpha: 0.1);
}

.alert-warning {
  background: change-color($yellow, $alpha: 0.2);
  border-color: change-color($yellow, $alpha: 0.8);
}

.alert-danger {
  background: change-color($red, $alpha: 0.2);
  border-color: change-color($red, $alpha: 0.2);
}

// Other theme overrides

a,
a:visited {
  color: $primary;
}

a:hover,
a:active {
  color: $primary;
  text-decoration: underline;
}

iframe {
  border: none;
  padding: 0;
  margin: 0;
}

code {
  padding: 0.2em 0.4em;
  margin: 0;
  border-radius: $border-radius;
  background: $gray-faint;
  color: $green;
}

pre {
  @include element-margin-bottom;

  background: $gray-faint;
  border-radius: $border-radius;
  padding: 1rem;

  code {
    background: transparent;
    border: 0;
    display: inline;
    font-size: $font-size-sm;
    line-height: inherit;
    margin: 0;
    max-width: auto;
    padding: 0;
    white-space: pre;
    word-break: normal;
    word-wrap: normal;
    overflow-x: auto;
    color: $green;
  }
}

.progress {
  background-color: $gray-lightest;
}

.progress-bar {
  background-color: $blue;
}

.icon {
  width: 0.9rem;
  height: 0.9rem;
}
